Release 10.1A: OpenEdge Getting Started:
Object-oriented Programming


Class-based model

Class-based objects support a programming model where you design and instantiate objects based on strongly-typed classes. Like procedure-based objects, classes maintain a run-time context that can be accessed by other objects. For class-based objects this context also includes various types of data, but instead of internal procedures and user-defined functions, the object’s behavior is provided by methods. A class-based method is a unit of executable code that has features in common with both internal procedures and user-defined functions, as well as features unique to methods.

Note: Class-based object methods are analogous to, but entirely different from the built-in methods that the 4GL provides on internal object handles, such as procedure, buffer, and query object handles (among many others). The main difference is that class-based methods are almost entirely user-defined and associated with the user-defined classes in which they are defined.

With class-based objects, the state and behavior in one object has a well-defined (strongly typed) relationship to the state and behavior in another class-based object. You establish most such relationships at compile time by syntax designed to associate class-based objects with each other in a well-defined hierarchy. As a result, you can organize class-based objects using interfaces that are well defined before you even compile the objects.

If you change an interface or relationship between the objects, many errors can be caught at compile-time that might not be caught for some time using procedure-based objects at run time. Because relationships among class-based objects can be defined at compile-time, Progress also supports standard management features for creating and deleting (destroying) these objects in a consistent and less error-prone manner. When you access state or behavior in other class-based objects, you can have greater confidence that this access is both permissible and appropriate for your designed task.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095